$.fn.extend({
    lazyload(){
        let totalShowHeight = (window.innerHeight || document.documentElement.clientHeight) + (document.body.scrollTop || document.documentElement.scrollTop);
        this.each((index,item) => {
            console.log(this);
            let currentHeight = $(item).offset().top;
            if(totalShowHeight >= currentHeight){
                $(item).attr('src',$(item).attr('data-original'));
            }
        })
        window.onscroll = () => this.lazyload();
    }
})